#ifndef __USART_H
#define __USART_H
#include "stm32f10x.h"
//RS232
#define			UART5_RX_BUF		512
extern u8 		UART5_RX_Buff[UART5_RX_BUF];
extern u16 		UART5_RX_STA;
extern u8		UART5_RX_FRAME;
//8112
#define			UART4_RX_BUF		10
extern u8 		UART4_RX_Buff[UART4_RX_BUF];
extern u16 		UART4_RX_STA;
extern u8		UART4_RX_FRAME;

//rs485
#define			UART3_RX_BUF		(1024+200)	
extern u8 		UART3_RX_Buff[UART3_RX_BUF];
extern u16 		UART3_RX_STA;
extern u8		UART3_RX_FRAME;

//gps
#define			UART2_RX_BUF		400
extern u8 		UART2_RX_Buff[UART2_RX_BUF];
extern u16 		UART2_RX_STA;
extern u8		UART2_RX_FRAME;

//wifi
#define			UART1_RX_BUF		(1024+200)	
extern u8 		UART1_RX_Buff[UART1_RX_BUF];
extern u16 		UART1_RX_STA;
extern u8		UART1_RX_FRAME;



void USART1_Init(u32 bound);
void USART2_Init(u32 bound);
void USART3_Init(u32 bound);
void USART4_Init(u32 bound);
void USART5_Init(u32 bound);


u8 usart1_send_char(u8 ch);
void usart1_send_string(u8 *str);

u8 usart2_send_char(u8 ch);
void usart2_send_string(u8 *str);

u8 usart3_send_char(u8 ch);
void usart3_send_string(u8 *str);

u8 usart4_send_char(u8 ch);
void usart4_send_string(u8 *str);

u8 usart5_send_char(u8 ch);
void usart5_send_string(u8 *str);


void	USARTx_Send(USART_TypeDef* USARTx,u8* data,u32 len);
#endif


